<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    let name = 'tony';
    let eat = function () {
        console.log('eating...')
    }
    const cat = {
        //不必 name:name
        name,
        eat,
        sleep() {
            console.log('sleeping')
        }
    }

    let {sleep} = cat;
    sleep()
</script>
</body>
</html>
